<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/font-awesome.min.css">
    <style>
        .layui-form-item .layui-form-label{
            width: 120px;
        }
        .layui-form-item .layui-textarea{
            width: 190px;
        }
        .layui-form-item .layui-input-inline:nth-child(3){width:50px;}
        #phone-one-div {display: none}
    </style>
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form" lay-filter="form1" method="post" action="?type=1">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
              <legend>{:session('uname','','admin')} 的周数据汇报</legend>
            </fieldset> 
             
            <input type="hidden" name="id" id="id" value="{$data.id}">
            <div class="layui-form-item">
                <label for="spend_time" class="layui-form-label">
                    选择周期
                </label>
                <div class="layui-input-inline">
                    <select name="week_date" id="week_date" lay-filter="date1">
                    {volist name="week_dates" id="value"}
                    <option value="{$value}" {$value==input('date1')?'selected':''}>{$key == 0?'上周':'本周'} {:date('Y-m-d',$value)} - {:date('Y-m-d',($value+86400*6) )}</option>
                    {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="wxtg_count" class="layui-form-label">
                    微信通过数量
                </label>
                <div class="layui-input-inline">
                    <input type="text" value="{$data.wxtg_count}" id="wxtg_count" name="wxtg_count" lay-verify="required" required="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="bdxkhdh_count" class="layui-form-label">
                    拨打新客户电话数量
                </label>
                <div class="layui-input-inline">
                    <input type="text" value="{$data.bdxkhdh_count}" id="bdxkhdh_count" name="bdxkhdh_count" lay-verify="required" required="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="xkhdhjt_count" class="layui-form-label">
                    新客户电话接通数量
                </label>
                <div class="layui-input-inline">
                    <input type="text" value="{$data.xkhdhjt_count}" id="xkhdhjt_count" name="xkhdhjt_count" lay-verify="required" required="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button type="submit" class="layui-btn" lay-filter="add" lay-submit="">
                  保存
                </button>
            </div>
      </form>
      <form class="layui-form" lay-filter="form2" method="post" action="?type=2">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
              <legend>{:session('uname','','admin')} 的月度活动数量汇报</legend>
            </fieldset> 
             
            <div class="layui-form-item">
                <label for="spend_time" class="layui-form-label">
                    选择周期
                </label>
                <div class="layui-input-inline">
                    <select name="month_date" id="month_date"  lay-filter="date2">
                    {volist name="month_dates" id="value"}
                    <option value="{$value}" {$value==input('date2')?'selected':''}>{$key == 0?'本月':'上月'} {:date('Y-m',$value)}</option>
                    {/volist}
                    </select>
                </div>
            </div>
            {volist name="can_start_count" id="v"}
            <div class="layui-form-item">
                <label for="wxtg_count" class="layui-form-label">
                    签单客户及场次
                </label>
                <div class="layui-input-inline">
                    <div class="layui-input-inline">
                        <select name="client_id[]" id="client_id[]" lay-search lay-verify="required" required>
                            <option value="">请选择</option>
                            {volist name="clientList" id="value"}
                            <option value="{$value.id}" {if condition="$value.id == $v.client_id"}selected{/if}>{$value.id}-{$value.activity}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-input-inline">
                    <input type="number" value="{$v.count}" id="count[]" name="count[]" placeholder="场次" lay-verify="required" required autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline">
                    <input type="text" value="{$v.live_ids}" id="live_ids[]" name="live_ids[]" placeholder="直播间id 多个用，分隔" lay-verify="required" required autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-xs">删除</button>
                </div>
            </div>
            {/volist}
            <div class="layui-form-item">
                <label for="wxtg_count" class="layui-form-label">
                    签单客户及场次
                </label>
                <div class="layui-input-inline">
                    <div class="layui-input-inline">
                        <select name="client_id[]" id="client_id[]" lay-search lay-verify="required" required>
                            <option value="">请选择</option>
                            {volist name="clientList" id="value"}
                            <option value="{$value.id}">{$value.id}-{$value.activity}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-input-inline">
                    <input type="number" value="" id="count[]" name="count[]" placeholder="场次" lay-verify="required" required autocomplete="off" class="layui-input">
                </div>
            
                <div class="layui-input-inline">
                    <input type="text" value="" id="live_ids[]" name="live_ids[]" placeholder="直播间id 多个用，分隔" lay-verify="required" required autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" onclick="$(this).parent().parent().remove()">删除</button>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="wxtg_count" class="layui-form-label">
                </label>
                <div class="layui-input-inline">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" id="add-btn">增加</button>
                </div>
            </div>
            
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button type="submit" class="layui-btn" lay-filter="add" lay-submit="">
                  保存
                </button>
            </div>
      </form>
      
<div style="display:none" id="can_start_count_item">
<div class="layui-form-item">
    <label for="wxtg_count" class="layui-form-label">
        签单客户及场次
    </label>
    <div class="layui-input-inline">
        <div class="layui-input-inline">
            <select name="client_id[]" id="client_id[]" lay-search lay-verify="required" required>
                <option value="">请选择</option>
                {volist name="clientList" id="value"}
                <option value="{$value.id}">{$value.id}-{$value.activity}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-input-inline">
        <input type="number" value="" id="count[]" name="count[]" placeholder="场次" lay-verify="required" required autocomplete="off" class="layui-input">
    </div>

    <div class="layui-input-inline">
        <input type="text" value="" id="live_ids[]" name="live_ids[]" placeholder="直播间id 多个用，分隔" lay-verify="required" required autocomplete="off" class="layui-input">
    </div>
    <div class="layui-input-inline">
        <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" onclick="$(this).parent().parent().remove()">删除</button>
    </div>
</div>
</div>
            
    </div>
    <script>

        layui.use(['form','layer','laydate','upload','layarea'], function(){
          $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer
          ,laydate = layui.laydate
          ,upload = layui.upload;
            
            $('#add-btn').click(function(){
                $(this).parent().parent().before( $('#can_start_count_item').html() );
                form.render('select');
            })
            form.on('select(date1)', function(data){
                window.location.href= "{$_SERVER['REQUEST_URL']}?date1="+data.value+"&date2="+form.val("form2").month_date ;
            });      
            form.on('select(date2)', function(data){
                window.location.href= "{$_SERVER['REQUEST_URL']}?date2="+data.value+"&date1="+form.val("form1").week_date ;
            }); 
            //监听提交
            /*form.on('submit(add)', function(data){
                $.ajax({
                    type:'POST',
                    dataType:'json',
                    data:{data:data.field},
                    success:function(obj){
                          layer.alert(obj.msg, {icon: obj.icon},function(){
                            // 获得frame索引
                            var index = parent.layer.getFrameIndex(window.name);
                            //关闭当前frame
                            parent.layer.close(index);
                            // 可以对父窗口进行刷新 
                            x_admin_father_reload();
                          });    
                    }
                });
                return false;
             });*/
          
          
        });
    </script>
  </body>

</html>